{% extends 'frontend/themes/coffee/base.html' %}
{% block title %}首页{% endblock %}
{% block content %}
  <div id="content-container">
    {% for i in diaries %}
    <div class="post">
      <h1><a class="post-title" href="{{ url_for('frontend.diary_detail', diary_id=i.id, diary_title=i.title) }}" title="{{ i.title }}">{{ i.title }}</a></h1>
      <div class="author">
        <span>作者:</span> <a>{{ i.author.name }}</a>&nbsp;
        <span>日期:</span> {{ i.publish_time.strftime('%Y-%m-%d %H:%M') }}&nbsp;
        <span>标签:</span>{% for t in i.tags %} <a href="/tag/{{t}}" title="{{t}}">{{t}}</a>{% endfor %}
      </div>

      <p>{{ i.summary|safe }}</p>
      <p>详细阅读... <a href="{{ url_for('frontend.diary_detail', diary_id=i.id, diary_title=i.title) }}" class="more-link">(more…)</a></p>

      <div class="post-comment-entice">
        <p><span class="post-comments"><a href="{{ url_for('frontend.diary_detail', diary_id=i.id, diary_title=i.title) }}">{{ i.comments|count }} Comments </a></span></p>
      </div>
    </div>
    {% endfor %}
  </div>
  {% if next_page == True %}
  <div id="bottom-paging">
    <a href="/diary/list/2">Older Posts »</a>
  </div>
  {% endif %}
{% endblock %}
